home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / appkit.507 < prev    next >
Text File  |  1992-02-06  |  1KB  |  24 lines

  1. {\rtf0\ansi{\fonttbl\f1\fnil Times-Roman;\f2\fmodern Ohlfs;\f0\fswiss Helvetica;}
  2. \paperw13520
  3. \paperh9880
  4. \margl120
  5. \margr120
  6. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f1\b0\i0\ul0\fs28 textfield tag text delegate\
  7. \
  8. Q:  How can I determine which TextField is being edited, while performing a delegate method such as textWillEnd: or textDidChange:?\
  9. \
  10. A: All of TextField's delegate methods send the Text object as an argument.  You can message this Text object to get ITS delegate, which has been set to the id of the TextField being edited. If you have several TextFields in a Matrix (or a Form) then the Matrix (or the Form) is the delegate of the Text object. In which case you should use the following method calls to get the actual TextField:\
  11. \
  12.  
  13. \f2\fs22     [[sender delegate] selectedCell];\
  14.  
  15. \f1\fs28     \
  16. This code will also work for individual TextFields, because single Controls return self when asked for selectedCell.  So we recommend that you use the above code snippet in all cases.\
  17. \
  18. QA507\
  19.     \
  20. Valid for 1.0\
  21. Valid for 2.0\
  22. \
  23.  
  24.